void _gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
GtkTreeView *tree_view);
void _gtk_tree_view_column_set_width (GtkTreeViewColumn *column,
- int width);
+ int width,
+ int internal_width);
void _gtk_tree_view_column_unset_model (GtkTreeViewColumn *column,
GtkTreeModel *old_model);
void _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column);
list = (rtl ? list->prev : list->next))
{
gint real_requested_width = 0;
+ gint internal_column_width = 0;
gint old_width, column_width;
column = list->data;
real_requested_width = gtk_tree_view_get_real_requested_width_from_column (tree_view, column);
allocation.x = width;
- _gtk_tree_view_column_set_width (column, real_requested_width);
if (gtk_tree_view_column_get_expand (column))
{
{
/* We add the remander to the last column as
* */
- column->width += extra;
+ real_requested_width += extra;
}
else
{
- column->width += extra_per_column;
+ real_requested_width += extra_per_column;
extra -= extra_per_column;
number_of_expand_columns --;
}
else if (number_of_expand_columns == 0 &&
list == last_column)
{
- column->width += extra;
+ real_requested_width += extra;
}
/* In addition to expand, the last column can get even more
* extra space so all available space is filled up.
*/
if (extra_for_last > 0 && list == last_column)
- column->width += extra_for_last;
+ real_requested_width += extra_for_last;
- g_object_notify (G_OBJECT (column), "width");
+ /* XXX This needs to account the real allocated space for
+ * the internal GtkCellArea
+ */
+ internal_column_width = real_requested_width /* - all the stuff treeview adds around the area */;
+
+ _gtk_tree_view_column_set_width (column, real_requested_width, internal_column_width);
column_width = gtk_tree_view_column_get_width (column);
allocation.width = column_width;
void
_gtk_tree_view_column_set_width (GtkTreeViewColumn *tree_column,
- int width)
+ int width,
+ int internal_width)
{
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
- gtk_cell_area_context_allocate (tree_column->cell_area_context, width, -1);
+ gtk_cell_area_context_allocate (tree_column->cell_area_context, internal_width, -1);
tree_column->width = width;
+
+ g_object_notify (G_OBJECT (tree_column), "width");
}
/**